export const option = {
    tooltip: {
        trigger: 'axis',
        //formatter: '{a}',
        textStyle: {
            fontSize: 10
        },
    },
    legend:[{
        name:'占比一',
        textStyle:{
            color:'#fff'
        }

    },{
        name:'占比二',
        textStyle:{
            color:'#fff'
        }
    }],
    //color: ['#32b16c', '#00a0e9'],
    xAxis: [{
        type: 'category',
        axisline: {
            show: false
        },
        axisLabel: {
            textStyle: {
                color: '#909293',
            }
        },

        axisTick: {
            show: false
        },
        axisline: {
            show: true,
            lineStyle: {
                type: 'dotted'
            }
        },
        data: ['A', 'B', 'C', 'D', 'E'],
    }],
    yAxis: [{
        type: 'value',
        min: 0,
        axisLabel: {
            textStyle: {
                color: '#909293',
            }
        },
        splitLine: {
            show: true,
            lineStyle: {
                type: 'dashed',
                color: '#3b4042',
            }
        },
        axisTick: {
            show: false
        },
    }],
    series: [{
        name: '占比一',
        type: 'bar',
        stack:'all',
        smooth: 0.5,
        showSymbol: false,
        data: [20, 30, 10, 80, 60],
        barWidth: 8,
        itemStyle: {
            color: 'rgba(36,135,204,0.3)',
            borderColor:'#00a0e9',
            borderWidth:2,
            borderType:'solid',
            borderRadius:10
        },
        showBackground: true,
        backgroundStyle: {
            color: 'rgba(255,255,255,0.14)',
        }
    },{
        name: '占比二',
        type: 'bar',
        stack:'all',
        data: [80, 80, 80, 80, 80],
        barWidth: 8,
        itemStyle: {
            color: 'rgba(50,177,108,0.14)',
            borderColor:'#32b16c',
            borderWidth:2,
            borderType:'solid'
        }
    }]
}

export function handlerOptions(chart, newConfig) {
    if (newConfig && (Object.keys(newConfig).length !== 0)) {
        chart.setOption({ ...newConfig }, false);
    }
}